package javabase.schoolwork.day6_11;

/**
 * @author fance
 * @date 18-6-11 下午6:04
 */
class Person{
    public Person(int age) {
        if (age < 18) {
            throw new RuntimeException("error");
        }
    }
    public void  seeMovie() {
        System.out.println("keke ...");
    }
}
public class Test11 {
    public static void main(String[] args) {
        Person person = new Person(20);
        person.seeMovie();
      /* try {
           System.out.println( dpStuff(-1));
           System.out.println( dpStuff(100));

       } catch (Exception e) {
           System.out.println(" down...");
       }*/
    }

    public static int dpStuff(int p) {
        try {
            if (p < 0) {

                throw new Exception("error");

        } else {
            return p;
        }

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            return -1;
        }
    }
}
